<?php
class CodemirrorWidget extends CWidget
{
	public $id='code';   
    public $name='';
    public $contents='';
    public function init()
    {
        parent::init();
    }

    public function run()
    {
        $name=$this->name;
		$contents=$this->contents;
		if ($this->id == 'code') {
        	$id = $this->id.time();
		} else {
			$id = $this->id;
		}
        $this->render('codemirror',compact('name','contents','id'));
    }
}
?>
